var WxParse = require('../../wxParse/wxParse.js');
//引入接口
import API from '../../config/server.js'
Page({
  data:{
    newData:{}
  },
  onLoad(option)
  {
    // console.log(option)
    let id = option.id
    this.getInfo(id)
  },
  getInfo(id){
    let that=this
    wx.showLoading({
      title: '加载中...',
    })
    wx.request({
      url: API.guangDetail,
      data: {id},
      header: {},
      method: 'get',
      dataType: 'json',
      responseType: 'text',
      success: function(res) {
        let data=res.data
        console.log(data)
        that.setData({ newData: data})
        WxParse.wxParse('article', 'html', data.content, that, 5);
      },
      fail: function(res) {
        wx.showToast({
          title: '网络错误',
          icon: 'error',
        })
      },
      complete: function(res) {
        wx.hideLoading()
      },
    })
  }
  


  
})